Conversation
…isolation Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Signed-off-by: ddjain <darjain@redhat.com>
Review Summary by QodoAdd CPU hog scenario functional tests to v2 framework
WalkthroughsDescription• Add CPU hog scenario functional tests with ephemeral namespace isolation • Implement test cases for success lifecycle, node selector, duration validation • Add failure scenarios for invalid node selector and malformed YAML • Create base scenario configuration for CPU hog stress testing Diagramflowchart LR
A["CPU Hog Test Suite"] --> B["Success & Lifecycle Test"]
A --> C["Node Selector & Duration Test"]
A --> D["Invalid Node Selector Test"]
A --> E["Invalid Scenario YAML Test"]
B --> F["Verify Pod Creation & Cleanup"]
C --> G["Validate Timing & Exit Code"]
D --> H["Assert Kraken Failure"]
E --> H
A --> I["Base Scenario Config"]
File Changes1. CI/tests_v2/scenarios/cpu_hog/test_cpu_hog.py
|
Code Review by Qodo
1. Unhandled kraken timeout
|
| proc = self.run_kraken_background(config_path) | ||
| try: | ||
| pods = _wait_for_hog_pod( | ||
| self.k8s_core, ns, self.HOG_POD_PREFIX, timeout=POLICY_WAIT_TIMEOUT | ||
| ) | ||
| assert len(pods) >= 1, f"Expected at least one hog pod in namespace={ns}" | ||
| finally: | ||
| # duration=10 + pod wait (30s) + cleanup; allow 90s for Krkn to exit. | ||
| stdout, stderr = proc.communicate(timeout=90) |
There was a problem hiding this comment.
1. Unhandled kraken timeout 🐞 Bug ⛯ Reliability
test_cpu_hog_success_and_lifecycle calls proc.communicate(timeout=90) without handling subprocess timeout, so a slow/hung kraken run will raise and leave the background process running (with stdout/stderr pipes) and can hang the overall test session.
Agent Prompt
### Issue description
`test_cpu_hog_success_and_lifecycle` starts Kraken in the background and calls `proc.communicate(timeout=90)` without handling `subprocess.TimeoutExpired`. If Kraken hangs or runs longer than expected, the test errors out and can leave the subprocess running (with stdout/stderr pipes), which may stall the test session and leak cluster resources.
### Issue Context
- `run_kraken_background` uses `stdout=PIPE` and `stderr=PIPE`.
- The test suite already defines configurable timeout constants (`KRAKEN_PROC_WAIT_TIMEOUT`, `TIMEOUT_BUDGET`, etc.) via env vars.
### Fix Focus Areas
- CI/tests_v2/scenarios/cpu_hog/test_cpu_hog.py[56-69]
- CI/tests_v2/lib/base.py[38-46]
### Suggested implementation notes
- Wrap `proc.communicate(...)` in `try/except subprocess.TimeoutExpired`.
- On timeout: `proc.terminate()` then `proc.kill()` if still running; drain output; then fail with a clear message.
- Replace the hard-coded `90` with `KRAKEN_PROC_WAIT_TIMEOUT` or a computed timeout derived from `scenario['duration']` plus a buffer.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Type of change
Description
Scenario
hog_scenarios): runs a CPU stress workload on selected nodes for a set duration, then removes the hog pods.Test cases
node-selector=kubernetes.io/os=linuxandduration=10; exit 0 and run time in expected range (~8–90s).Tests use ephemeral namespaces (no pre-deployed workload)
Related Tickets & Documents
If no related issue, please create one and start the converasation on wants of